/**
 * 检测是否在元素之外点击
 */
export function isOutEleClick(ele: HTMLElement, cb: (arg0: boolean) => any) {
  document.addEventListener('click', (evt: MouseEvent) => {
    // isClickedOutside 为 true 如果点击的元素在 ele 之外
    const isClickedOutside = !ele.contains(evt.target as EventTarget as any)
    cb && cb(isClickedOutside)
  })
}
